﻿using System.Collections.Generic;
using UcAsp.Net.IDAL;
using UcAsp.Net.Model;

namespace UcAsp.Net.BLL
{
    public class CourseBLL
    {
        private static readonly ICourseDAL dal = DALFactory.DataAccess.CreateCourse();
        public List<Course> Select(int pagesize, int pageindex, out int pagecount)
        {
            return dal.Select(pagesize, pageindex, out pagecount);
        }
        public List<Course> GetCourseByActionID(int pagesize, int pageindex, out int pagecount, int actionid)
        {
            return dal.GetCourseByActionID(pagesize, pageindex, out pagecount, actionid);
        }
        public Course GetCourseByID(int id)
        {
            return dal.GetCourseByID(id);
        }
        public bool Insert(Course model)
        {
            return dal.Insert(model);
        }
        public bool Update(Course model)
        {
            return dal.Update(model);
        }
        public bool Delete(int id)
        {
            Course model = GetCourseByID(id);
            return dal.Delete(model);
        }
    }
}